#include <stdio.h>
#include <stdlib.h>

int main(){
    int a=100, b=200;

    const int *p=&a;
    int * const q=&b;
    printf("a=%d, *p=%d, &a=%p, p=%p\n",a,*p,&a,p);
    printf("b=%d, *q=%d, &b=%p, q=%p\n",b,*q,&b,q);

    //原文*p=b;
    p=&b;
    printf("执行p=&b;\n*p=%d, p=%p\n\n",*p,p);

    //原文q=&a;
    *q=a;
    printf("执行*q=a;\n*q=%d, b=%d, a=%d, q=%p\n\n",*q,b,a,q);

    system("pause");
    return 0;
}